package com.edu.xidian.topic.consumer;

import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

import javax.jms.JMSException;
import javax.jms.TextMessage;

@Component
public class Topic_Consumer {

    @JmsListener(destination = "${myTopic}")  // 监听
    public void reveive(TextMessage textMessage) throws JMSException {

        System.out.println("*******消费者受到订阅的主题******" + textMessage.getText());

    }

}
